// 将绿线数据转换为LFTViewer需要的格式
export const transData = (data) => {
  return data.map((item) => ({
    type: 'polyline',
    payload: {
      id: item.id || 'green-line',
      latlngs: item.positions,
      options: {
        color: item.color || '#00ff00',
        weight: 10,
        lineCap: 'round',
        lineJoin: 'round',
      },
      event: {
        onClick: (e) => {
          console.log('绿线被点击', e);
          item.onClick?.(e);
        },
      },
    },
  }));
};
